import request from '@/utils/request' // api
import serve from '@/utils/serve' // ips

// 查询入库单
export function getStockPage() {
  return request({
    url: '/receipt/list'
  })
}

// 分页查询入库单
export function getStockPageDetail() {
  return serve({
    url: '/receipt/pageDetail'
  })
}
// 搜索查询
export function searchStockPageDetail(params) {
  return serve({
    url: `/receipt/pageDetail`,
    params
  })
}

// 新增入库单
export const addStockPage = (data) => serve.post('/receipt', data)

// 获取入库单号
export function getStockNum() {
  return request({
    url: '/codeFactory/next/RK'

  })
}

// 根据id分页查询入库单
export function getPageDetail(data) {
  return serve({
    url: `/receipt/pageDetail${data.id}`
  })
}
// 写入货主获取货主id
export function getOwnerInfo() {
  return request({
    url: '/owner/list'
  })
}

// 根据货主id获取仓库名字
export function getWarehouseName(id) {
  return request({
    url: `/warehouse/list?status=1&ownerId=${id}`
  })
}

// 根据货主id获取仓库商品
export function getGoodsPageDetail(id) {
  return request({
    url: `/goods/pageDetail${id}`
  })
}

// 获取收货单
export function getReceivingNote(params) {
  return serve({
    url: `/receiving/pageDetail`,
    params
  })
}
// 分页查询上架任务明细
export function getPutaway(params) {
  return serve({
    url: `/grounding/pageDetail`,
    params
  })
}

// 分页查询收货任务明细
export function getReceivingDetail(params) {
  return serve({
    url: `/receiptList/pageDetail`,
    params
  })
}

